let _getDictItemsByParentId = null;
let _getDictListByPage = null;
let _ossServiceInfo = null;
let _fileDownload = null;
let _getUserList = null;
let _searchUser = null;
let _getOrgTree = null;
let _getFormInfoListByPage = null;
let _getColumnList = null;
let _getFormDataListByPage = null;
let _getThirdApiListByPage = null;
let _triggerThirdApi = null;
let _createCustomComponent = null;
let _getCustomComponentListByPage = null;
let _previewComponentAddress = null;
let _getCustomComponentList = null;
let _exportFormModel2Excel = null;
let _uploadExcel = null;
let _excelData2Table = null;
export const initAdapter = (adapter = {}) => {
  console.log('INIT API ADAPTER');
  _getDictItemsByParentId = adapter.getDictItemsByParentId;
  _getDictListByPage = adapter.getDictListByPage;
  _ossServiceInfo = adapter.ossServiceInfo;
  _fileDownload = adapter.fileDownload;
  _getUserList = adapter.getUserList;
  _searchUser = adapter.searchUser;
  _getOrgTree = adapter.getOrgTree;
  _getFormInfoListByPage = adapter.getFormInfoListByPage;
  _getColumnList = adapter.getColumnList;
  _getFormDataListByPage = adapter.getFormDataListByPage;
  _getThirdApiListByPage = adapter.getThirdApiListByPage;
  _triggerThirdApi = adapter.triggerThirdApi;
  _createCustomComponent = adapter.createCustomComponent;
  _getCustomComponentListByPage = adapter.getCustomComponentListByPage;
  _previewComponentAddress = adapter.previewComponentAddress;
  _getCustomComponentList = adapter.getCustomComponentList;
  _exportFormModel2Excel = adapter.exportFormModel2Excel;
  _uploadExcel = adapter.uploadExcel;
  _excelData2Table = adapter.excelData2Table;
};
export const getDictItemsByParentId = (params) => {
  if (_getDictItemsByParentId) {
    return _getDictItemsByParentId(params);
  } else {
    return new Error('adapter must use after initialization!');
  }
};
export const getDictListByPage = (params) => {
  if (_getDictListByPage) {
    return _getDictListByPage(params);
  } else {
    return new Error('adapter must use after initialization!');
  }
};
export const ossServiceInfo = (params) => {
  if (_ossServiceInfo) {
    return _ossServiceInfo(params);
  } else {
    return new Error('adapter must use after initialization!');
  }
};
export const fileDownload = (params) => {
  if (_fileDownload) {
    return _fileDownload(params);
  } else {
    return new Error('adapter must use after initialization!');
  }
};
export const getUserList = (params) => {
  if (_getUserList) {
    return _getUserList(params);
  } else {
    return new Error('adapter must use after initialization!');
  }
};
export const searchUser = (params) => {
  if (_searchUser) {
    return _searchUser(params);
  } else {
    return new Error('adapter must use after initialization!');
  }
};
export const getOrgTree = (params) => {
  if (_getOrgTree) {
    return _getOrgTree(params);
  } else {
    return new Error('adapter must use after initialization!');
  }
};
export const getFormInfoListByPage = (params) => {
  if (_getFormInfoListByPage) {
    return _getFormInfoListByPage(params);
  } else {
    return new Error('adapter must use after initialization!');
  }
};
export const getColumnList = (params) => {
  if (_getColumnList) {
    return _getColumnList(params);
  } else {
    return new Error('adapter must use after initialization!');
  }
};
export const getFormDataListByPage = (params) => {
  if (_getFormDataListByPage) {
    return _getFormDataListByPage(params);
  } else {
    return new Error('adapter must use after initialization!');
  }
};
export const getThirdApiListByPage = (params) => {
  if (_getThirdApiListByPage) {
    return _getThirdApiListByPage(params);
  } else {
    return new Error('adapter must use after initialization!');
  }
};
export const triggerThirdApi = (params) => {
  if (_triggerThirdApi) {
    return _triggerThirdApi(params);
  } else {
    return new Error('adapter must use after initialization!');
  }
};
export const createCustomComponent = (params) => {
  if (_createCustomComponent) {
    return _createCustomComponent(params);
  } else {
    return new Error('adapter must use after initialization!');
  }
};
export const getCustomComponentListByPage = (params) => {
  if (_getCustomComponentListByPage) {
    return _getCustomComponentListByPage(params);
  } else {
    return new Error('adapter must use after initialization!');
  }
};
export const previewComponentAddress = (params) => {
  if (_previewComponentAddress) {
    return _previewComponentAddress(params);
  } else {
    return new Error('adapter must use after initialization!');
  }
};
export const getCustomComponentList = (params) => {
  if (_getCustomComponentList) {
    return _getCustomComponentList(params);
  } else {
    return new Error('adapter must use after initialization!');
  }
};
export const exportFormModel2Excel = (params) => {
  if (_exportFormModel2Excel) {
    return _exportFormModel2Excel(params);
  } else {
    return new Error('adapter must use after initialization!');
  }
};
export const uploadExcel = (params) => {
  if (_uploadExcel) {
    return _uploadExcel(params);
  } else {
    return new Error('adapter must use after initialization!');
  }
};
export const excelData2Table = (params) => {
  if (_excelData2Table) {
    return _excelData2Table(params);
  } else {
    return new Error('adapter must use after initialization!');
  }
};
